package com.duoqin.account.data.remote;

import com.duoqin.account.data.LoginRequest;
import com.duoqin.account.data.LoginResponse;
import com.duoqin.account.data.RefreshTokenResponse;
import com.duoqin.account.data.RegisterRequest;
import com.duoqin.common.data.DefaultResponse;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface AccountApiInterface {
    @GET("service/verify")
    Call<DefaultResponse> requestValidationCode(@Query("mobile") String mobile);

    @POST("uc/user")
    Call<LoginResponse> register(@Header("Authorization") String authorization,
                                    @Body RegisterRequest registerRequest);

    @DELETE("uc/user")
    Call<DefaultResponse> logout(@Header("Authorization") String token);

    @POST("uc/login")
    Call<LoginResponse> login(@Body LoginRequest loginRequest);

    @GET("uc/token")
    Call<RefreshTokenResponse> refreshToken(@Header("Authorization") String token);
}